// EXE 2.2 完成英寸和米的转换
package main

import (
	"fmt"
	"gopl.io/onclass/lengthconv"
	"os"
	"strconv"
)

func main() {
	for _, arg := range os.Args[1:] {
		t, err := strconv.ParseFloat(arg, 64)
		if err != nil {
			fmt.Fprintf(os.Stderr, "error: %v\n", err)
			os.Exit(2)
		}
		inch := lengthconv.Inch(t)
		meter := lengthconv.Meter(t)
		fmt.Printf("%s = %s, %s = %s\n", inch, lengthconv.InchToMeter(inch), meter, lengthconv.MeterToInch(meter))
	}
}
